#include "FileTransfareEvent.h"

namespace Impp
{

DEFINE_EVENT_TYPE(EVT_FILE_TRANSFARE) 

FileTransfareEvent::FileTransfareEvent(const ActionId & actionId, Buddy* sender, const wxString & fileName, size_t fileCount, size_t totalSize, wxEventType eventType, int id) :
	wxNotifyEvent(eventType,id),
	actionId(actionId),
	sender(sender),
	fileName(fileName),
	fileCount(fileCount),
	totalSize(totalSize)
{
}

FileTransfareEvent::~FileTransfareEvent()
{
}

Buddy* FileTransfareEvent::getSender(){
	return sender;
}

ActionId FileTransfareEvent::getActionId()
{
	return actionId;
}
wxString FileTransfareEvent::getInfoString()
{
	if(fileCount == 1){
		return wxString::Format(wxT("%s (%i b)"), fileName.c_str(), totalSize);
	}
	return wxString::Format(wxT("%i files (%i b)"), fileCount, totalSize);
}

wxEvent* FileTransfareEvent::Clone() const {
	return new FileTransfareEvent(*this);
};

}
